package org.spring.springboot.app.user.sysuser.domain.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel(description = "邮箱找回密码返回参数")
public class MailSendResVO {
    @ApiModelProperty(value = "账号邮箱地址", hidden = false)
    private String email;

    public String getEmail() {
        if (email != null && email.length() > 0) {
            String[] mail = email.split("@");
            String prefix = "****";
            if (mail[0].length() > 4) {
                prefix = mail[0].substring(0, 4) + prefix;
            }
            String suffix = mail[1];
            email = prefix + "@" + suffix;
        }
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }
}
